home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 2002 November / SGI IRIX 6.5 Applications 2002 November.iso / dev / java2v131_02_dev.idb / usr / java2v131_02 / lib / ir.idl.z / ir.idl
Encoding:
Text File  |  2002-06-19  |  18.2 KB  |  768 lines

  1. /*
  2.  * @(#)ir.idl    1.13 98/10/11
  3.  *
  4.  * Copyright 1997, 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. /*
  16.  * This file contains OMG IDL from  CORBA V2.0, July 1995.
  17.  * It also contains the TypeCode creation APIs in CORBA::ORB
  18.  **/
  19.  
  20. #pragma prefix "omg.org"
  21.  
  22. module CORBA {
  23.     typedef string Identifier;
  24.     typedef string ScopedName;
  25.     typedef string RepositoryId;
  26.  
  27.     enum DefinitionKind {
  28.     dk_none, dk_all,
  29.     dk_Attribute, dk_Constant, dk_Exception, dk_Interface,
  30.     dk_Module, dk_Operation, dk_Typedef,
  31.     dk_Alias, dk_Struct, dk_Union, dk_Enum,
  32.     dk_Primitive, dk_String, dk_Sequence, dk_Array,
  33.     dk_Repository,
  34.     dk_Wstring, dk_Fixed,
  35.     dk_Value, dk_ValueBox, dk_ValueMember, // orbos 98-01-18: Objects By Value
  36.     dk_Native
  37.     };
  38.  
  39.  
  40.     interface IRObject
  41.     /**
  42.       An IRObject IDL interface represents the most generic interface
  43.       from which all other Interface Repository interfaces are derived,
  44.       even the Repository itself.
  45.      */
  46.     {
  47.     // read interface
  48.     readonly attribute DefinitionKind def_kind;
  49.  
  50.     // write interface
  51.     void destroy ();
  52.     };
  53.  
  54.  
  55.  
  56.     typedef string VersionSpec;
  57.  
  58.     interface Contained;
  59.     interface Repository;
  60.     interface Container;
  61.  
  62.     interface Contained : IRObject
  63.     /**
  64.        The Contained Interface is inherited by all Interface Repository
  65.        interfaces that are contained by other objects.
  66.      */
  67.     {
  68.     // read/write interface
  69.  
  70.     attribute RepositoryId id;
  71.     attribute Identifier name;
  72.     attribute VersionSpec version;
  73.  
  74.     // read interface
  75.  
  76.     readonly attribute Container defined_in;
  77.     readonly attribute ScopedName absolute_name;
  78.     readonly attribute Repository containing_repository;
  79.  
  80.     struct Description {
  81.         DefinitionKind kind;
  82.         any value;
  83.     };
  84.  
  85.     Description describe ();
  86.  
  87.     // write interface
  88.  
  89.     void move (
  90.         in Container new_container,
  91.         in Identifier new_name,
  92.         in VersionSpec new_version
  93.         );
  94.     };
  95.  
  96.  
  97.     interface ModuleDef;
  98.     interface ConstantDef;
  99.     interface IDLType;
  100.     interface StructDef;
  101.     interface UnionDef;
  102.     interface EnumDef;
  103.     interface AliasDef;
  104.     interface InterfaceDef;
  105.     interface ExceptionDef;
  106.     interface ValueDef;        // orbos 98-01-18: Objects By Value
  107.     interface ValueMemberDef;    // orbos 98-01-18: Objects By Value
  108.     interface ValueBoxDef;    // orbos 98-01-18: Objects By Value
  109.     interface NativeDef;
  110.  
  111.  
  112.     typedef sequence <InterfaceDef> InterfaceDefSeq;
  113.  
  114.  
  115.     typedef sequence <Contained> ContainedSeq;
  116.  
  117.     struct StructMember {
  118.     Identifier name;
  119.     TypeCode type;
  120.     IDLType type_def;
  121.     };
  122.     typedef sequence <StructMember> StructMemberSeq;
  123.  
  124.     struct UnionMember {
  125.     Identifier name;
  126.     any label;
  127.     TypeCode type;
  128.     IDLType type_def;
  129.     };
  130.     typedef sequence <UnionMember> UnionMemberSeq;
  131.  
  132.  
  133.     typedef sequence <Identifier> EnumMemberSeq;
  134.  
  135.     // orbos 98-01-18: Objects By Value -- begin
  136.     typedef short Visibility;    
  137.     const Visibility PRIVATE_MEMBER = 0; 
  138.     const Visibility PUBLIC_MEMBER = 1;
  139.  
  140.     struct ValueMember {
  141.         Identifier name;
  142.     RepositoryId id;
  143.     RepositoryId defined_in;
  144.     VersionSpec version;
  145.         TypeCode type;
  146.         IDLType type_def;
  147.         Visibility access;
  148.     };
  149.     typedef sequence <ValueMember> ValueMemberSeq;
  150.  
  151.     struct Initializer {
  152.         StructMemberSeq members;
  153.     };
  154.     typedef sequence <Initializer> InitializerSeq;
  155.  
  156.     typedef sequence <ValueDef> ValueDefSeq;
  157.     
  158.     // orbos 98-01-18: Objects By Value -- end
  159.  
  160.  
  161.     interface Container : IRObject
  162.     /**
  163.       The Container interface is used to form a containment hierarchy
  164.       in the Interface Repository. A Container can contain any number
  165.       of objects derived from the Contained interface.
  166.     */
  167.     {
  168.     // read interface
  169.  
  170.     Contained lookup ( in ScopedName search_name);
  171.  
  172.     ContainedSeq contents (
  173.         in DefinitionKind limit_type,
  174.         in boolean exclude_inherited
  175.         );
  176.  
  177.     ContainedSeq lookup_name (
  178.         in Identifier search_name,
  179.         in long levels_to_search,
  180.         in DefinitionKind limit_type,
  181.         in boolean exclude_inherited
  182.         );
  183.  
  184.     struct Description {
  185.         Contained contained_object;
  186.         DefinitionKind kind;
  187.         any value;
  188.     };
  189.  
  190.     typedef sequence<Description> DescriptionSeq;
  191.  
  192.     DescriptionSeq describe_contents (
  193.         in DefinitionKind limit_type,
  194.         in boolean exclude_inherited,
  195.         in long max_returned_objs
  196.         );
  197.  
  198.     // write interface
  199.  
  200.     ModuleDef create_module (
  201.         in RepositoryId id,
  202.         in Identifier name,
  203.         in VersionSpec version
  204.         );
  205.  
  206.     ConstantDef create_constant (
  207.         in RepositoryId id,
  208.         in Identifier name,
  209.         in VersionSpec version,
  210.         in IDLType type,
  211.         in any value
  212.         );
  213.  
  214.     StructDef create_struct (
  215.         in RepositoryId id,
  216.         in Identifier name,
  217.         in VersionSpec version,
  218.         in StructMemberSeq members
  219.         );
  220.  
  221.     UnionDef create_union (
  222.         in RepositoryId id,
  223.         in Identifier name,
  224.         in VersionSpec version,
  225.         in IDLType discriminator_type,
  226.         in UnionMemberSeq members
  227.         );
  228.  
  229.     EnumDef create_enum (
  230.         in RepositoryId id,
  231.         in Identifier name,
  232.         in VersionSpec version,
  233.         in EnumMemberSeq members
  234.         );
  235.  
  236.     AliasDef create_alias (
  237.         in RepositoryId id,
  238.         in Identifier name,
  239.         in VersionSpec version,
  240.         in IDLType original_type
  241.         );
  242.  
  243.         ExceptionDef create_exception (
  244.             in RepositoryId    id,
  245.             in Identifier      name,
  246.             in VersionSpec     version,
  247.             in StructMemberSeq members
  248.         );
  249.  
  250.  
  251.     InterfaceDef create_interface (
  252.         in RepositoryId id,
  253.         in Identifier name,
  254.         in VersionSpec version,
  255.         in boolean is_abstract,
  256.         in InterfaceDefSeq base_interfaces
  257.         );
  258.  
  259.     // orbos 98-01-18: Objects By Value
  260.     ValueDef create_value(
  261.         in RepositoryId id,
  262.         in Identifier name,
  263.         in VersionSpec version,
  264.         in boolean is_custom,
  265.         in boolean is_abstract,
  266.         in octet flags,    // must be 0
  267.         in ValueDef base_value,
  268.         in boolean has_safe_base,
  269.         in ValueDefSeq abstract_base_values,
  270.         in InterfaceDefSeq supported_interfaces,
  271.         in InitializerSeq initializers
  272.         );
  273.     
  274.     // orbos 98-01-18: Objects By Value
  275.     ValueBoxDef create_value_box(
  276.         in RepositoryId id,
  277.         in Identifier name,
  278.         in VersionSpec version,
  279.         in IDLType original_type_def
  280.         );
  281.     
  282.     NativeDef create_native(
  283.         in RepositoryId id,
  284.         in Identifier name,
  285.         in VersionSpec version
  286.         );
  287.     
  288.     };
  289.  
  290.  
  291.  
  292.     interface IDLType : IRObject
  293.     /**
  294.        The IDLType interface is an abstract interface inherited by all
  295.        IR objects that represent the OMG IDL types. It provides access
  296.        to the TypeCode describing the type, and is used in defining the
  297.        other interfaces wherever definitions of IDLType must be referenced.
  298.     */
  299.     {
  300.     readonly attribute TypeCode type;
  301.     };
  302.  
  303.  
  304.  
  305.     interface PrimitiveDef;
  306.     interface StringDef;
  307.     interface SequenceDef;
  308.     interface ArrayDef;
  309.  
  310.     enum PrimitiveKind {
  311.     pk_null, pk_void, pk_short, pk_long, pk_ushort, pk_ulong,
  312.     pk_float, pk_double, pk_boolean, pk_char, pk_octet,
  313.     pk_any, pk_TypeCode, pk_Principal, pk_string, pk_objref
  314.     };
  315.  
  316.     interface Repository : Container
  317.     /**
  318.       Repository is an interface that provides global access to the
  319.       Interface Repository. Repository objects can contain constants,
  320.       typedefs, exceptions, interfaces, and modules.
  321.     */
  322.     {
  323.     // read interface
  324.  
  325.     Contained lookup_id (in RepositoryId search_id);
  326.  
  327.     PrimitiveDef get_primitive (in PrimitiveKind kind);
  328.  
  329.     // write interface
  330.  
  331.     StringDef create_string (in unsigned long bound);
  332.  
  333.     SequenceDef create_sequence (
  334.         in unsigned long bound,
  335.         in IDLType element_type
  336.         );
  337.  
  338.     ArrayDef create_array (
  339.         in unsigned long length,
  340.         in IDLType element_type
  341.         );
  342.     };
  343.  
  344.  
  345.     interface ModuleDef : Container, Contained
  346.     /**
  347.       A ModuleDef can contain constants, typedefs, exceptions, interfaces,
  348.       and other module objects.
  349.     */
  350.     {
  351.     };
  352.  
  353.     struct ModuleDescription {
  354.     Identifier name;
  355.     RepositoryId id;
  356.     RepositoryId defined_in;
  357.     VersionSpec version;
  358.     };
  359.  
  360.  
  361.     interface ConstantDef : Contained
  362.     /**
  363.       A ConstantDef object defines a named constant.
  364.     */
  365.     {
  366.     readonly attribute TypeCode type;
  367.     attribute IDLType type_def;
  368.     attribute any value;
  369.     };
  370.  
  371.     struct ConstantDescription {
  372.     Identifier name;
  373.     RepositoryId id;
  374.     RepositoryId defined_in;
  375.     VersionSpec version;
  376.     TypeCode type;
  377.     any value;
  378.     };
  379.  
  380.  
  381.     interface TypedefDef : Contained, IDLType
  382.     /**
  383.       TypedefDef is an abstract interface used as a base interface for
  384.       all named non-object types(structures, unions, enumerations,
  385.       aliases). The TypedefDef interface is not inherited by the definition
  386.       objects for the primitive or anonymous types.
  387.     */
  388.     {
  389.     };
  390.  
  391.     struct TypeDescription {
  392.     Identifier name;
  393.     RepositoryId id;
  394.     RepositoryId defined_in;
  395.     VersionSpec version;
  396.     TypeCode type;
  397.     };
  398.  
  399.  
  400.     interface StructDef : TypedefDef, Container
  401.     /**
  402.        A StructDef represents an OMG IDL structure definition.
  403.     */
  404.     {
  405.     attribute StructMemberSeq members;
  406.     };
  407.  
  408.  
  409.     interface UnionDef : TypedefDef, Container
  410.     /**
  411.        A UnionDef represents an OMG IDL union definition.
  412.      */
  413.     {
  414.     readonly attribute TypeCode discriminator_type;
  415.     attribute IDLType discriminator_type_def;
  416.     attribute UnionMemberSeq members;
  417.     };
  418.  
  419.  
  420.     interface EnumDef : TypedefDef
  421.     /**
  422.       A EnumDef represents an OMG IDL enum definition.
  423.      */
  424.     {
  425.     attribute EnumMemberSeq members;
  426.     };
  427.  
  428.  
  429.     interface AliasDef : TypedefDef
  430.     /**
  431.        An AliasDef represents an OMG IDL typedef that aliases other
  432.        definition.
  433.     */
  434.     {
  435.     attribute IDLType original_type_def;
  436.     };
  437.  
  438.  
  439.     interface PrimitiveDef: IDLType
  440.     /**
  441.       A PrimitiveDef represents one of the IDL primitive types. As
  442.       primitive types are unnamed, this interface is not derived from
  443.       TypedefDef or Contained.
  444.      */
  445.     {
  446.     readonly attribute PrimitiveKind kind;
  447.     };
  448.  
  449.  
  450.     interface StringDef : IDLType
  451.     /**
  452.       A StringDef represents an OMG IDL string type. As string
  453.       types are anonymous, this interface is not derived from TypedefDef
  454.       or Contained.
  455.     */
  456.     {
  457.     attribute unsigned long bound;
  458.     };
  459.  
  460.  
  461.     interface SequenceDef : IDLType
  462.     /**
  463.       A SequenceDef represents an OMG IDL sequence type. As sequence
  464.       types are anonymous, this interface is not derived from TypedefDef
  465.       or Contained.
  466.      */
  467.     {
  468.     attribute unsigned long bound;
  469.     readonly attribute TypeCode element_type;
  470.     attribute IDLType element_type_def;
  471.     };
  472.  
  473.     interface ArrayDef : IDLType
  474.     /**
  475.       An ArrayDef represents an OMG IDL array type. As array
  476.       types are anonymous, this interface is not derived from TypedefDef
  477.       or Contained.
  478.     */
  479.     {
  480.     attribute unsigned long length;
  481.     readonly attribute TypeCode element_type;
  482.     attribute IDLType element_type_def;
  483.     };
  484.  
  485.  
  486.     interface ExceptionDef : Contained, Container
  487.     /**
  488.       An ExceptionDef represents an exception definition.
  489.     */
  490.     {
  491.     readonly attribute TypeCode type;
  492.     attribute StructMemberSeq members;
  493.     };
  494.     struct ExceptionDescription {
  495.     Identifier name;
  496.     RepositoryId id;
  497.     RepositoryId defined_in;
  498.     VersionSpec version;
  499.     TypeCode type;
  500.     };
  501.  
  502.  
  503.  
  504.     enum AttributeMode {ATTR_NORMAL, ATTR_READONLY};
  505.  
  506.     interface AttributeDef : Contained
  507.     /**
  508.       An AttributeDef represents the information that defines an
  509.       attribute of an interface.
  510.     */
  511.     {
  512.     readonly attribute TypeCode type;
  513.     attribute IDLType type_def;
  514.     attribute AttributeMode mode;
  515.     };
  516.  
  517.     struct AttributeDescription {
  518.     Identifier name;
  519.     RepositoryId id;
  520.     RepositoryId defined_in;
  521.     VersionSpec version;
  522.     TypeCode type;
  523.     AttributeMode mode;
  524.     };
  525.  
  526.  
  527.  
  528.     enum OperationMode {OP_NORMAL, OP_ONEWAY};
  529.  
  530.     enum ParameterMode {PARAM_IN, PARAM_OUT, PARAM_INOUT};
  531.     struct ParameterDescription {
  532.     Identifier name;
  533.     TypeCode type;
  534.     IDLType type_def;
  535.     ParameterMode mode;
  536.     };
  537.     typedef sequence <ParameterDescription> ParDescriptionSeq;
  538.  
  539.     typedef Identifier ContextIdentifier;
  540.     typedef sequence <ContextIdentifier> ContextIdSeq;
  541.  
  542.     typedef sequence <ExceptionDef> ExceptionDefSeq;
  543.     typedef sequence <ExceptionDescription> ExcDescriptionSeq;
  544.  
  545.     interface OperationDef : Contained
  546.     /**
  547.       An OperationDef represents the information that defines an
  548.       operation of an interface.
  549.      */
  550.     {
  551.     readonly attribute TypeCode result;
  552.     attribute IDLType result_def;
  553.     attribute ParDescriptionSeq params;
  554.     attribute OperationMode mode;
  555.     attribute ContextIdSeq contexts;
  556.     attribute ExceptionDefSeq exceptions;
  557.     };
  558.  
  559.     struct OperationDescription {
  560.     Identifier name;
  561.     RepositoryId id;
  562.     RepositoryId defined_in;
  563.     VersionSpec version;
  564.     TypeCode result;
  565.     OperationMode mode;
  566.     ContextIdSeq contexts;
  567.     ParDescriptionSeq parameters;
  568.     ExcDescriptionSeq exceptions;
  569.     };
  570.  
  571.  
  572.  
  573.     typedef sequence <RepositoryId> RepositoryIdSeq;
  574.     typedef sequence <OperationDescription> OpDescriptionSeq;
  575.     typedef sequence <AttributeDescription> AttrDescriptionSeq;
  576.  
  577.     interface InterfaceDef : Container, Contained, IDLType
  578.     /**
  579.       An InterfaceDef object represents an interface definition. It can
  580.       contains constants, typedefs, exceptions, operations, and
  581.       attributes.
  582.      */
  583.     {
  584.     // read/write interface
  585.  
  586.     attribute InterfaceDefSeq base_interfaces;
  587.     attribute boolean is_abstract;
  588.  
  589.     // read interface
  590.  
  591.     boolean is_a (in RepositoryId interface_id);
  592.  
  593.     struct FullInterfaceDescription {
  594.         Identifier name;
  595.         RepositoryId id;
  596.         RepositoryId defined_in;
  597.         VersionSpec version;
  598.         boolean is_abstract;
  599.         OpDescriptionSeq operations;
  600.         AttrDescriptionSeq attributes;
  601.         RepositoryIdSeq base_interfaces;
  602.         TypeCode type;
  603.     };
  604.  
  605.     FullInterfaceDescription describe_interface();
  606.  
  607.     // write interface
  608.  
  609.     AttributeDef create_attribute (
  610.         in RepositoryId id,
  611.         in Identifier name,
  612.         in VersionSpec version,
  613.         in IDLType type,
  614.         in AttributeMode mode
  615.         );
  616.  
  617.     OperationDef create_operation (
  618.         in RepositoryId id,
  619.         in Identifier name,
  620.         in VersionSpec version,
  621.         in IDLType result,
  622.         in OperationMode mode,
  623.         in ParDescriptionSeq params,
  624.         in ExceptionDefSeq exceptions,
  625.         in ContextIdSeq contexts
  626.         );
  627.     };
  628.  
  629.     struct InterfaceDescription {
  630.     Identifier name;
  631.     RepositoryId id;
  632.     RepositoryId defined_in;
  633.     VersionSpec version;
  634.     RepositoryIdSeq base_interfaces;
  635.     };
  636.  
  637.  
  638.     // orbos 98-01-18: Objects By Value -- begin
  639.  
  640.     interface ValueMemberDef : Contained
  641.  
  642.       /** A <code>ValueMemberDef</code> object represents the public
  643.       and private data member definition of a <code>Value</code> type
  644.       */
  645.  
  646.  {
  647.         readonly attribute TypeCode type;
  648.              attribute IDLType type_def;
  649.          attribute Visibility access;
  650.     };
  651.  
  652.     interface ValueDef : Container, Contained, IDLType
  653.       /**
  654.     A ValueDef object represents the definition of the
  655.     <code>Value</code> object used to pass the object state
  656.     between hosts
  657.     */
  658.  
  659.       {
  660.        // read/write interface
  661.         attribute InterfaceDefSeq supported_interfaces;
  662.         attribute InitializerSeq initializers;
  663.         attribute ValueDef base_value;
  664.         attribute ValueDefSeq abstract_base_values;
  665.         attribute boolean is_abstract;
  666.         attribute boolean is_custom;
  667.         attribute octet flags; // always 0
  668.         attribute boolean has_safe_base;
  669.  
  670.         // read interface
  671.         boolean is_a(in RepositoryId value_id);
  672.  
  673.         struct FullValueDescription {
  674.           Identifier     name;
  675.           RepositoryId     id;
  676.           boolean     is_abstract;
  677.           boolean     is_custom;
  678.           octet         flags; // always 0
  679.           RepositoryId     defined_in;
  680.           VersionSpec     version;
  681.           OpDescriptionSeq operations;
  682.           AttrDescriptionSeq attributes;
  683.           ValueMemberSeq     members;
  684.           InitializerSeq     initializers;
  685.           RepositoryIdSeq supported_interfaces;
  686.           RepositoryIdSeq abstract_base_values;
  687.           boolean     has_safe_base;
  688.           RepositoryId    base_value;
  689.           TypeCode    type;
  690.       };
  691.  
  692.       FullValueDescription describe_value();
  693.  
  694.       // write interface
  695.  
  696.       ValueMemberDef create_value_member(
  697.           in RepositoryId id,
  698.           in Identifier name,
  699.           in VersionSpec version,
  700.           in IDLType type_def,
  701.           in Visibility access
  702.       );
  703.  
  704.       AttributeDef create_attribute(
  705.           in RepositoryId id,
  706.           in Identifier   name,
  707.           in VersionSpec  version,
  708.           in IDLType      type,
  709.           in AttributeMode mode
  710.       );
  711.  
  712.       OperationDef create_operation(
  713.           in RepositoryId id,
  714.           in Identifier   name,
  715.           in VersionSpec  version,
  716.           in IDLType      result,
  717.           in OperationMode     mode,
  718.           in ParDescriptionSeq params,
  719.           in ExceptionDefSeq   exceptions,
  720.           in ContextIdSeq contexts
  721.       );
  722.     };
  723.     struct ValueDescription {
  724.         Identifier name;
  725.         RepositoryId id;
  726.         boolean is_abstract;
  727.         boolean is_custom;
  728.         octet   flags; // always 0
  729.         RepositoryId defined_in;
  730.         VersionSpec version;
  731.         RepositoryIdSeq supported_interfaces;
  732.         RepositoryIdSeq abstract_base_values;
  733.         boolean has_safe_base;
  734.         RepositoryId base_value;
  735.     };
  736.  
  737.     interface ValueBoxDef : IDLType 
  738.  
  739.       /** ValueBoxDef is an interface that reresents a value type with
  740.     a single data member inside its state section and no
  741.     inheritance or methods. For example, when transmitting a
  742.     string or sequence as an actual parameter on an interface
  743.     operation or as a data member of a value type that is an
  744.     actual parameter, it may be important to preserve any sharing
  745.     of the string or sequence within the object graph being
  746.     transmitted. Because current IDL data types do not preserve
  747.     referential integrity in this way, this requirement is
  748.     conveniently handled by using a value type. Value types also
  749.     support the transmission of nulls (as a distinguished value),
  750.     whereas IDL data types such as string and sequence (which are
  751.     mapped to empty strings and sequences) do not. The Java to IDL
  752.     mapping requires both preservation of referential integrity
  753.     and transmission of nulls. Because it would be cumbersome to
  754.     require the full IDL syntax for a value type for this specific
  755.     usage, this shorthand notation is introduced to cover this use
  756.     of value types for simple containment of a single data member.
  757.     */
  758.  
  759. {
  760.         attribute IDLType original_type_def;
  761.     };
  762.     
  763.     // orbos 98-01-18: Objects By Value -- end
  764.  
  765.     interface NativeDef : TypedefDef {
  766.     };
  767. };
  768.